package com.gl.saasservice.house.repository;

import com.gl.saasservice.house.entity.BacklogItem;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface BacklogItemRepository extends PagingAndSortingRepository<BacklogItem, Long>, JpaSpecificationExecutor<BacklogItem> {

    @Query("from BacklogItem  where houseId=?1 and type=?2 and DATE_FORMAT(create_time, '%Y-%m-%d') = ?3")
    BacklogItem findByHouseIdAndType(String houseId, Integer type, String date);

    List<BacklogItem> findByHouseIdAndTypeAndHandleStatus(String houseId, Integer type, Integer handleStatus);

}
